/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-20 16:24:01
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-20 16:47:52
 */
class SchoolAttendanceModel {
  int late;
  int personal;
  int total;
  int leave;
  List<Grades> grades;

  SchoolAttendanceModel(
      {this.late, this.personal, this.total, this.leave, this.grades});

  SchoolAttendanceModel.fromJson(Map<String, dynamic> json) {
    late = json['late'];
    personal = json['personal'];
    total = json['total'];
    leave = json['leave'];
    if (json['grades'] != null) {
      grades = new List<Grades>();
      json['grades'].forEach((v) {
        grades.add(new Grades.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['late'] = this.late;
    data['personal'] = this.personal;
    data['total'] = this.total;
    data['leave'] = this.leave;
    if (this.grades != null) {
      data['grades'] = this.grades.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Grades {
  String classname;
  int total;
  int attendance;

  Grades({this.classname, this.total, this.attendance});

  Grades.fromJson(Map<String, dynamic> json) {
    classname = json['classname'];
    total = json['total'];
    attendance = json['attendance'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['classname'] = this.classname;
    data['total'] = this.total;
    data['attendance'] = this.attendance;
    return data;
  }
}
